package SwingModel;

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;

public class CmsLecture {

	private final int lectureID;
	private final String courseID;
	private final File lectureFile;
	private Date avaiDate;
	private Date expDate;
	
	public CmsLecture(int lectureID, File lectureFile){
		this.lectureID = lectureID;
		courseID = "";
		this.lectureFile = lectureFile;
		avaiDate = new Date(); //current Date of the system
		expDate = new Date(5000000000000l);//this is in the year of 2128 - testing
	}
	
	public CmsLecture(int lectureID, String courseID, File lectureFile, Date avaiDate, Date expDate){
		this.lectureID = lectureID;
		this.lectureFile = lectureFile;
		this.courseID = courseID;
		this.setAvaiDate(avaiDate);
		this.setExpDate(expDate);
	}
	
	
	@Override
	public String toString(){
		SimpleDateFormat sdf = new SimpleDateFormat("YYYY:MM:dd HH:mm:ss");
		return "Lecture: \n"
				+ "lectureID: " + lectureID + "\n"
				+ "courseID: " + courseID + "\n"
				+ "lectureFile" + lectureFile.getPath() + "\n"
				+ "avaiDate: " + sdf.format(avaiDate) + "\n"
				+ "expDate: " + sdf.format(expDate) + "\n";
	}
	

	//---------------------------------------------------------
	//GETTERS AND SETTERS:
	//---------------------------------------------------------
	public int getLectureID() {
		return lectureID;
	}

	public File getLectureFile() {
		return lectureFile;
	}

	public Date getAvaiDate() {
		return avaiDate;
	}

	public void setAvaiDate(Date avaiDate) {
		this.avaiDate = avaiDate;
	}

	public Date getExpDate() {
		return expDate;
	}

	public void setExpDate(Date expDate) {
		this.expDate = expDate;
	}

	public String getCourseID() {
		return courseID;
	}
	
	
}
